From: Keir Fraser Date: Thu, 29 Oct 2009 14:48:28 +0000 (+0000) Subject: Extend the max vcpu number for HVM guest. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13152 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=6785f5fef31f5c94d6d7902aea61237cf08420b1;p=xen.git Extend the max vcpu number for HVM guest. - Originally the max vcpu number for HVM guest is 32, this patch extend the number to 128 on x86_64 hypervisor. (For i386 hypervisor, the max vcpu number is still 32). - This patch extends the mp-table size to fit more vcpus. - HVM PV driver should call VCPUOP_register_vcpu_info hypercall to initialize the vcpu info if the vcpu number is more than 32. Signed-off-by: Dongxiao Xu Signed-off-by: Keir Fraser --- diff --git a/tools/firmware/rombios/rombios.c b/tools/firmware/rombios/rombios.c index 2d97a401d5..8330f808c2 100644 --- a/tools/firmware/rombios/rombios.c +++ b/tools/firmware/rombios/rombios.c @@ -10734,11 +10734,19 @@ post_init_pic: out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 ret + + .align 16 +smbios_entry_point: + db 0,0,0,0,0,0,0,0 ; 8 bytes + db 0,0,0,0,0,0,0,0 ; 16 bytes + db 0,0,0,0,0,0,0,0 ; 24 bytes + db 0,0,0,0,0,0,0 ; 31 bytes + ;; the following area can be used to write dynamically generated tables .align 16 bios_table_area_start: - dd 0xaafb4442 - dd bios_table_area_end - bios_table_area_start - 8; + db 0x5F, 0x5F, 0x5F, 0x48, 0x56, 0x4D, 0x4D, 0x50 ;; ___HVMMP + dd bios_table_area_end - bios_table_area_start ;-------- ;- POST - @@ -11843,41 +11851,6 @@ static Bit8u vgafont8[128*8]= 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00, }; -#ifdef HVMASSIST -ASM_START - -// -// MP Tables -// just carve out some blank space for HVMLOADER to write the MP tables to -// -// NOTE: There should be enough space for a 32 process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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 832 bytes -dw 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ;; 896 bytes - -.align 16 -smbios_entry_point: -db 0,0,0,0,0,0,0,0 ; 8 bytes -db 0,0,0,0,0,0,0,0 ; 16 bytes -db 0,0,0,0,0,0,0,0 ; 24 bytes -db 0,0,0,0,0,0,0 ; 31 bytes -ASM_END - -#endif // HVMASSIST ASM_START .org 0xcff0 bios_table_area_end: diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index a76ff6e4ce..94457a3281 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3098,7 +3098,7 @@ int shadow_enable(struct domain *d, u32 mode) { unsigned int r; shadow_lock(d); - r = sh_set_allocation(d, 256, NULL); /* Use at least 1MB */ + r = sh_set_allocation(d, 1024, NULL); /* Use at least 4MB */ if ( r != 0 ) { sh_set_allocation(d, 0, NULL); diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 290b9494dd..0c417c7fea 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -456,7 +456,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) ret = -EINVAL; if ( (d == current->domain) || /* no domain_pause() */ (max > MAX_VIRT_CPUS) || - (is_hvm_domain(d) && max > XEN_LEGACY_MAX_VCPUS) ) + (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) ) { rcu_unlock_domain(d); break; diff --git a/xen/include/asm-ia64/config.h b/xen/include/asm-ia64/config.h index 0d24feb19d..8194b4476c 100644 --- a/xen/include/asm-ia64/config.h +++ b/xen/include/asm-ia64/config.h @@ -32,6 +32,7 @@ #define NR_CPUS 64 #endif #define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS +#define MAX_HVM_VCPUS MAX_VIRT_CPUS #define CONFIG_NUMA #define CONFIG_ACPI_NUMA #define NODES_SHIFT 8 /* linux/asm/numnodes.h */ diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index d465c3b1f9..8c9b3c1d9e 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -57,6 +57,9 @@ #define MAX_VIRT_CPUS XEN_LEGACY_MAX_VCPUS #endif +/* Maximum we can support with current vLAPIC ID mapping. */ +#define MAX_HVM_VCPUS 128 + #ifdef CONFIG_X86_SUPERVISOR_MODE_KERNEL # define supervisor_mode_kernel (1) #else